import type { IFormData } from "./types";

export class SpecFormData implements IFormData {
  name: string = "";
  values: string[] = [];
  description: string = "";
  category_id:string = "";
  deleted_at: string = "";

  constructor(data?: Partial<SpecFormData>) {
    this.reset();
    if (data) Object.assign(this, data);
  }

  reset(): void {
    Object.assign(this, {
      name: "",
      values: [],
      description: "",category_id:"",
      deleted_at: "",
    });
  }

  toSubmitData() {
    return {
      name: this.name,
      values: this.values,
      description: this.description,category_id:this.category_id,
      deleted_at: this.deleted_at,
    };
  }
}
